package com.sinoyd.itszyw.Model;

import org.json.JSONObject;
import org.xutils.db.annotation.Column;
import org.xutils.db.annotation.Table;

import java.io.Serializable;

/**
 * @createBy : Sinoyd 大饼洲
 * @description :
 * @projectName : ITYW
 * @creationDate: 2017-04-14 16:41
 */

@Table(name = "repairs_info", onCreated = "")

public class RepairsInfo implements Serializable{
    /**
     * name = "id"：数据库表中的一个字段
     * isId = true：是否是主键
     * autoGen = true：是否自动增长
     * property = "NOT NULL"：添加约束
     */
    @Column(name = "id", isId = true, autoGen = true, property = "NOT NULL")
    private int id;

    @Column(name = "repairs_id")
    public String repairsId;

    @Column(name = "repairs_name")
    public String repairsName;

    //默认的构造方法必须写出，如果没有，这张表是创建不成功的
    public RepairsInfo() {

    }

    public void ParseRepairsInfo(JSONObject jsonObject) throws Exception{

        this.repairsId = jsonObject.getString("RowGuid");
        this.repairsName = jsonObject.getString("DisplayName");

    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }
}
